﻿function login() {
    var user = $("#user").val();
    var passwd = $("#passwd").val();
    if (IsNullOrEmpty(user) || IsNullOrEmpty(passwd)) {
        ShowMsg("用户名密码不允许为空","error");
        return;
    }
    ShowMsg("正在登陆中...");
    $.ajax({
        url: '../ashx/login.ashx?action=login',
        data: { user: user, passwd: passwd },
        success: function (r) {
            var ret = JSON.parse(r);
            console.dir(ret);
            if (ret.code == -1) {
                MsgClear();
                ShowMsg(ret.info,"error");
            } else {
                //window.location.href = "./main.html";
                //window.location.href = "./Report.aspx";
                window.location.href = "./MyTask.aspx";
            }
        }
    });
}
function clearForm() {
    $("#user").val("");
    $("#passwd").val("");
}
function forgetPsw() {

}